package com.xof.phonecall

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.Transformations
import com.xof.phonecall.base.BaseViewModel
import com.xof.phonecall.model.ToDoLoginTo
import com.xof.phonecall.network.RepoLaunch

class ViewModelLogin : BaseViewModel() {

    private val mLiveDataDoLogin = MutableLiveData<ToDoLoginTo>()

    val LiveDataDoLogin = Transformations.switchMap(mLiveDataDoLogin) { query ->
        RepoLaunch.doLogin(this, query)
    }

    fun doLogin(doLoginReq: ToDoLoginTo) {
        mLiveDataDoLogin.value = doLoginReq
    }
}